/*
构造函数
var aBlob = new Blob( array, options ); options = {{type},{options}}
参照MIME表 参考资源：https://www.w3school.com.cn/media/media_mimeref.asp
*/

export default function filesType(type)
{
  let file = ''
  switch(type) {
    case 'jpg':
    case 'jpeg':
    case 'jpe':
      file = 'image/jpeg,charset=UTF-8'
    break;
    case 'png':
      file = 'image/png,charset=UTF-8'
    break;
    case 'gif':
      file = 'image/gif,charset=UTF-8'
    break;
    case 'pdf':
      file = 'application/pdf,charset=UTF-8'
    break;
    case 'bmp':
      file = ' image/bmp,charset=UTF-8'
    break;
    case 'xlc':
    case 'xla':
    case 'xls':
    case 'xlt':
    case 'xlw':
      file = 'application/vnd.ms-excel,charset=UTF-8'
    break;
    case 'ppt':
    case 'pps':
    case 'pot':
      file = 'application/vnd.ms-powerpoint,charset=UTF-8'
    break;
    case 'txt':
      file = 'text/plain,charset=UTF-8'
    break;
    case 'doc':
      file = 'application/msword,charset=utf-8'
    break;
    case 'docx':
      file = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document,charset=UTF-8'
    break;
    case 'rar':
    case 'exe':
    case 'msi':
    case 'chm':
    case 'cab':
    case 'ocx':
      file = 'application/octet-stream,charset=UTF-8'
    break;
    case 'zip':
      file = 'application/x-zip-compressed'
    break;
    case 'xml':
      file = 'text/xml,charset=UTF-8'
    break;
    case 'html':
      file = 'text/html,charset=UTF-8'
    break;
    case 'css':
      file = 'text/css,charset=UTF-8'
    break;
    case 'js':
      file = 'text/js,charset=UTF-8'
    break
  }
  return file
}
